package ast_generator;

/**
 * 
 * @author Chu
 *AST Tree is an object that contains the head node of an AST Tree, and the name of the token that the tree identifies.
 */
public class ASTTree {
	private ASTNode root;
	private String tokenType;
	
	/**
	 *Default Constructor 
	 */
	public ASTTree() {
		root = null;
		tokenType = null;
	}
	/**
	 * Second contructor
	 * @param r Head nodeASTNode
	 * @param tokenName
	 */
	public ASTTree(ASTNode r, String tokenName)
	{
		root=r;
		tokenType=tokenName;
	}
	
	/**
	 * accessor method for the headnode
	 * @return root current head node
	 */
	public ASTNode getRoot() {
		return root;
	}
	/**
	 * setter method for the root node
	 * @param root headnode we want to set
	 */
	public void setRoot(ASTNode root) {
		this.root = root;
	}
	/**
	 * accessor method for tokenType
	 * @return tokenType 
	 */
	public String getTokenType() {
		return tokenType;
	}
	/**
	 * setter method for the tokenType
	 * @param root tokenType we want to set
	 */
	public void setTokenType(String tokenType) {
		this.tokenType = tokenType;
	}
	
	//Add more methods for adding nodes?
}
